﻿using System.Linq.Expressions;

namespace Domain.Repositories;

/// <summary>
/// 菜单仓储
/// </summary>
public interface IMenuRepository : IScopedDependency
{
    /// <summary>
    /// 通过条件获取所有菜单
    /// </summary>
    /// <param name="condition">条件</param>
    /// <returns>菜单数据</returns>
    IQueryable<Menu> GetAll(Expression<Func<Menu, bool>>? condition = null);

    /// <summary>
    /// 通过用户唯一标识获取所有菜单
    /// </summary>
    /// <param name="userId">用户唯一标识</param>
    /// <param name="isSystemAccount">是否为系统管理员</param>
    /// <param name="cancellationToken"></param>
    /// <returns>菜单数据</returns>
    Task<List<Menu>> GetUserMenusByUserIdAsync(long userId, bool isSystemAccount = false, CancellationToken cancellationToken = default);
}

